#ifndef __GEODETIC3D__H
#define __GEODETIC3D__H

#include <algorithm>
#include "Geodetic2D.h"
namespace Core{
	struct Geodetic3D
	{
	public:
		Geodetic3D(const double longitude, const double latitude, const double height)
		{
			_longitude = longitude;
			_latitude = latitude;
			_height = height;
		}

		Geodetic3D(const double longitude, const double latitude)
		{
			_longitude = longitude;
			_latitude = latitude;
			_height = 0;
		}

		Geodetic3D(const Geodetic2D &geodetic2D)
		{
			_longitude = geodetic2D.getLongitude();
			_latitude = geodetic2D.getLatitude();
			_height = 0;
		}

		Geodetic3D(const Geodetic2D &geodetic2D, double height)
		{
			_longitude = geodetic2D.getLongitude();
			_latitude = geodetic2D.getLatitude();
			_height = height;
		}

		const double getLongitude() const { return this->_longitude; }
		const double getLatitude() const { return _latitude; }
		const double getHeight() const { return _height; }

		const bool EqualsEpsilon(const Geodetic3D &other, double epsilon) const {
			return (std::abs(_longitude - other.getLongitude()) <= epsilon &&
				std::abs(_latitude - other.getLatitude()) <= epsilon &&
				std::abs(_height - other.getHeight()) <= epsilon);
		}

		const bool Equals(const Geodetic3D &other)const {
			return _longitude == other.getLongitude() && _latitude == other.getLatitude() &&
				_height == other.getHeight();
		}

		const bool operator ==(const Geodetic3D &right)const {
			return this->Equals(right);
		}

		const bool operator !=(const Geodetic3D &other)const {
			return !this->Equals(other);
		}


	private:
		double _longitude, _latitude, _height;
	};
}
#endif